package com.example.lisongyu;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

public class SexActivity extends AppCompatActivity {
    private LinearLayout idlinearLayout;
    private RadioGroup idMainRadioGroup1;
    private RadioButton idRbSex,idRbMale,idRbFemale,idRbBaoMi;
     private TextView idTvShow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sex);

        idlinearLayout=findViewById(R.id.idlinearLayout);
        idMainRadioGroup1=findViewById(R.id.idMainRadioGroup1);
        idTvShow=findViewById(R.id.idTvShow) ;
        //idRbMale=findViewById(R.id.idRbMale);
         // idRbFemale=findViewById(R.id.idRbFemale);

        idMainRadioGroup1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                idRbSex = findViewById(i);
                Toast.makeText(SexActivity.this,  "恭喜你，你是" + idRbSex.getText() + "de", Toast.LENGTH_SHORT).show();
            }

        });}}

